import service from "./request";

//统一管理应用程序中的请求

//一个请求封装成一个函数
export function user_login(params = {}){
    return service.post('/user/login',params)//post请求
}
//注册
export function user_register(params = {}){
    return service.post('/user/register',params)
}
//轮播图
export function banner_list(params = {}){
    return service.get('/banner/list',{params})//get请求
}
//店铺列表
export function shop_list(params = {}){
    return service.get('/shop/list',{params})
}
//店铺详情
export function shop_shopinfo(params = {}){
    return service.get('/shop/shopinfo',{params})
}
//店铺搜索 searchkey 关键词 必须传
export function shop_search(params = {}){
    return service.get('/shop/search',{params})
}
//收藏列表 userid 用户id 必须传
export function favlist(params = {}){
    return service.get('/shop/favlist',{params})
}
//收藏店铺 userid 用户id 必须传 ; shopid 店铺id 必须传
export function fav(params = {}){
    return service.post('/shop/fav',params)
}
//取消收藏店铺 userid 用户id 必须传 ; shopid 店铺id 必须传
export function unfav(params = {}){
    return service.post('/shop/unfav',params)
}
//购物车列表 userid 用户id 必须传
export function shopcart_list(params = {}){
    return service.get('/shopcart/list',{params})
}
//购物车清空
export function shopcart_clear(params = {}){
    return service.post('/shopcart/clear',params)
}
//购物车数量加1
export function shopcart_add(params = {}){
    return service.post('/shopcart/add',params)
}
//购物车数量减1
export function shopcart_sub(params = {}){
    return service.post('/shopcart/sub',params)
}
//收货地址列表
export function address_list(params = {}){
    return service.get('/address/list',{params})
}
//收货地址新建
export function address_add(params = {}){
    return service.post('/address/add',params)
}
//收货地址删除
export function address_del(params = {}){
    return service.post('/address/del',params)
}
//收货地址编辑
export function address_edit(params = {}){
    return service.post('/address/edit',params)
}
//爆爆团列表
export function tuan_list(params = {}){
    return service.get('/tuan/list',{params})
}